package com.u17;

/**
 * @author u17
 * https://leetcode-cn.com/problems/palindrome-number/
 */
public class Solution {

    public boolean isPalindrome(int x) {

        if (x < 0) {
            return false;
        }

        int result = 0;
        int temp = x;
        while (temp != 0) {
            int dev = temp % 10;
            temp = temp / 10;
            result = result * 10 + dev;
        }

        if (result != x) {
            return false;
        }

        return true;
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        boolean palindrome = solution.isPalindrome(1000000001);
        System.out.println(palindrome);
    }
}
